//
//  BookTableViewCell.m
//  简书-发现
//
//  Created by mafeng on 16/8/1.
//  Copyright © 2016年 mafeng. All rights reserved.
//

#import "BookTableViewCell.h"

@implementation BookTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
       
    
    }
    return  self;
}
- (void)awakeFromNib {
    // Initialization code
}
// 对button的圆角要放在layoutSubviews里面, 放在init里面不执行.(*.*)
- (void)layoutSubviews {
    [super layoutSubviews];
    _buttonLabel.layer.borderWidth = 1;
    _buttonLabel.layer.cornerRadius = 6;
    _buttonLabel.layer.borderColor = [UIColor purpleColor].CGColor;
}
- (void)setBook:(Book *)book {
    _book = book;
    _userNameLabel.text = book.userName;
    _dateLabel.text = book.date;
    _timeLabel.text = book.time;
    [_buttonLabel setTitle:book.labelButton forState:UIControlStateNormal];
    _titleLable.text = book.title;
    _countLable.text = book.readNum;
    _commentLabel.text = book.commentNum;
    _likeLabel.text = book.likeNum;
    _userImageView.image = [UIImage imageNamed:book.userImageString];
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
